<?php

namespace App\Admin\Controllers;

use App\Models\Sku as Model;
use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Form;
use Encore\Admin\Grid;
use Encore\Admin\Layout\Content;
use Encore\Admin\Show;
use Illuminate\Http\Request;


class ProductController extends AdminController
{


    protected $title = 'sku 列表';


    public function grid()
    {

        $grid = new Grid(new Model());
        $grid->column('id');
        $grid->column('sku','SKU');
        $grid->column('name','商品名称');
        $grid->column('category.title','商品分类');
        $grid->column('is_sale','是否采购')->using([0=>'否', 1=>'是']);
//        $grid->column('is_sale','是否采购')->display()
        $grid->column('weight','毛重（克）');
        $grid->column('net_weight','净重（克）');
        $grid->column('created_at');
        $grid->column('created_at','采购周期');
        $grid->column('created_at','最新起订');


        $grid->disableActions();
        $grid->disableCreateButton();

        return $grid;
    }






}
